<template>
  <div class="container page">
    <div class="orderlist" style="margin:30rpx" :key="profit" v-for="profit of listProfit">
        <div v-if="profit.order_status === 0">{{profit.earnings}} 提成订单号 {{profit.order_no}}</div>
        <div v-if="profit.order_status === 1">{{profit.earnings}} 跟团长 {{profit.heigher_user}} 进货差价 </div>


        <div>{{profit.create_time}}</div>
    </div>


  </div>
</template>
<script>
// var WXBizDataCrypt = require('@/tools/WXBizDataCrypt')
import qcloud from 'wafer2-client-sdk'

import {showSuccess, showModal} from '@/util'
import {get, post, getAuth} from '@/util'
// import {get2, post2} from '@/server/api'
import config from '@/config'
export default {

  data () {
    return {
      shippingInfo: {},
      shippingid: '',
      tabA: 0,
      listProfit: [],
      focus: true,
      inputValue: ''
    }
  },
  mounted () {
    this.userinfo = wx.getStorageSync('userinfo')
  },
  onShareAppMessage() {
    return {
      title: `华人耀酱香型白酒，传承古法工艺，与国酒茅台同宗同源同品。`,
      // imageUrl: 'https://www.rrjiaoyi.com/static/rr-min/share/share.png',
      path: `/pages/hcdindex/main?shareuser=${wx.getStorageSync('user').id}`
    }
  },
  methods: {
    async get_listProfit() {
      return await getAuth(`geweb/partner/listProfit?userId=${JSON.parse(wx.getStorageSync('user').id)}`, {}, {}).then(result => {

        if(result.code === 301) {
          // wx.hideLoading();
          // console.log("去登陆")
          wx.switchTab({
            url: `/pages/usercenter/main`
          })
          wx.showToast({
            title: '请登录',
            icon: 'none'
          })
        }

        if(result.code === 200) {
            console.log(result.res)
            this.listProfit = result.res;
            // wx.hideLoading();
        }
      })
    },
    productChoose (id) {
      // console.log(name, img, userId, accountId)
      wx.navigateTo({
        url: `/pages/product-detail/main?id=${id}`
      })
    },
    async player() {
      return await post('minipro/List', {}, {'api':'all', 'page':1})
    },
    async demo() {
    // return await get2('demo', {})
    },
    async joke() {
      return await get2('api/jokes', {})
    },
    predict () {
      wx.navigateTo({
        url: '/pages/search/main'
      })
    },
    jumpClick (comment) {
      wx.navigateTo({
        // url: '/pages/web-view/main'
        url: '/pages/web-view/main?path=' + 'https://wj.qq.com/s/2491547/f457/'
        // url: '/pages/detail/main'
      })
    }

  },
  onShow () {
      this.get_listProfit()
  }
}
</script>

<style scoped lang='scss'>
.container{
  font-size: 30rpx;
}
page {
  background-color: #ffffff;
  width: 100%;
  height: 100%;
}
.tz{
        text-align: center;
        margin-top: 20px;
        margin-bottom:60px;
    }
    .xsrh{
        text-align: center;
        margin-top: 50px;
    }
    .y{
        text-align: center;
        margin-top: 50rpx;
        font-size: 60rpx;
    }
    .b{
        text-align: center;
    }
    .b1{
        margin-top: 40px;
        margin-right: 20px;
        height: 30px;
        line-height: 30px;
        width: 80px;
        border-radius: 5px;
        background: #C8D3D1;
    }
    .b2{
        font-size: 30rpx;
        margin-top: 50rpx;
        height: 30px;
        line-height: 30px;
        width: 30%;
        border-radius: 5px;
        background: #C8D3D1;
    }
    .fgx{
        text-align: center;
        margin-top: 40px;
        background: #C8D3D1;
        width: 92%;
        height: 10px;
        margin-left: 4%;
    }
    .ys{
        text-align: center;
        margin-top: 10px;
        margin-left: 20px;
    }
    .syxq{
        color: red;
        font-size: 5px;
        margin-left: 20px;
    }
</style>
